 <template>
  <div id="app">
    <transition name="page" mode="out-in">
      <!-- 缓存首页和工单中心页，避免频繁重绘 -->
      <keep-alive include="Homepage">
        <router-view></router-view>
      </keep-alive>
    </transition>
    <FootNav></FootNav>

    <iframe v-if="showIframe" src="./static/logo.png" style="display:none"></iframe>
  </div>
</template>

<script>
import FootNav from '@/components/footer-nav'
// import wxconfig from '@/config/sdk.js'
// import wx from 'weixin-js-sdk'

export default {
  name: 'app',

  components: {
    FootNav
  },

  data () {
    return {
      showIframe: false
    }
  },

  computed: {
    inOutPage () {
      const OUT_PAGE = [
        '/login',
        '/forgot-password',
        '/forgot-password/send-success'
      ]
      let currentPath = this.$route.path
      return OUT_PAGE.some(path => path === currentPath)
    }
  },

  async mounted () {
    // wxconfig()
    this.init()
  },

  methods: {
    init () {
      if (this.inOutPage) return
      this.getPlugins()
    },
    /*
     * 获取插件列表
     */
    getPlugins () {
      // return this.$store.dispatch('plugin/fetchAllApps')
    }
  }
}
</script>

<style lang="stylus">
@import '~@/assets/style/base.styl'

html, body 
  width 100%
  height 100%
  padding 0
  margin 0
#app 
  height 100%
  width 100%
</style>
